Integrand size = 24, antiderivative size = 221 \[ \int (e x)^{-1+2 n} \left (a+b \sec \left (c+d x^n\right )\right )^2 \, dx=\frac {a^2 (e x)^{2 n}}{2 e n}-\frac {4 i a b x^{-n} (e x)^{2 n} \arctan \left (e^{i \left (c+d x^n\right )}\right )}{d e n}+\frac {b^2 x^{-2 n} (e x)^{2 n} \log \left (\cos \left (c+d x^n\right )\right )}{d^2 e n}+\frac {2 i a b x^{-2 n} (e x)^{2 n} \operatorname {PolyLog}\left (2,-i e^{i \left (c+d x^n\right )}\right )}{d^2 e n}-\frac {2 i a b x^{-2 n} (e x)^{2 n} \operatorname {PolyLog}\left (2,i e^{i \left (c+d x^n\right )}\right )}{d^2 e n}+\frac {b^2 x^{-n} (e x)^{2 n} \tan \left (c+d x^n\right )}{d e n} \]
1/2*a^2*(e*x)^(2*n)/e/n-4*I*a*b*(e*x)^(2*n)*arctan(exp(I*(c+d*x^n)))/d/e/n /(x^n)+b^2*(e*x)^(2*n)*ln(cos(c+d*x^n))/d^2/e/n/(x^(2*n))+2*I*a*b*(e*x)^(2 *n)*polylog(2,-I*exp(I*(c+d*x^n)))/d^2/e/n/(x^(2*n))-2*I*a*b*(e*x)^(2*n)*p olylog(2,I*exp(I*(c+d*x^n)))/d^2/e/n/(x^(2*n))+b^2*(e*x)^(2*n)*tan(c+d*x^n )/d/e/n/(x^n)
Time = 5.78 (sec) , antiderivative size = 347, normalized size of antiderivative = 1.57 \[ \int (e x)^{-1+2 n} \left (a+b \sec \left (c+d x^n\right )\right )^2 \, dx=\frac {x^{-2 n} (e x)^{2 n} \left (8 a b \arctan (\cot (c)) \text {arctanh}\left (\sin (c)+\cos (c) \tan \left (\frac {d x^n}{2}\right )\right )-\frac {4 a b \csc (c) \left (\left (d x^n-\arctan (\cot (c))\right ) \left (\log \left (1-e^{i \left (d x^n-\arctan (\cot (c))\right )}\right )-\log \left (1+e^{i \left (d x^n-\arctan (\cot (c))\right )}\right )\right )+i \operatorname {PolyLog}\left (2,-e^{i \left (d x^n-\arctan (\cot (c))\right )}\right )-i \operatorname {PolyLog}\left (2,e^{i \left (d x^n-\arctan (\cot (c))\right )}\right )\right )}{\sqrt {\csc ^2(c)}}+\frac {2 b^2 d x^n \sin \left (\frac {d x^n}{2}\right )}{\left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} \left (c+d x^n\right )\right )-\sin \left (\frac {1}{2} \left (c+d x^n\right )\right )\right )}+\frac {2 b^2 d x^n \sin \left (\frac {d x^n}{2}\right )}{\left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} \left (c+d x^n\right )\right )+\sin \left (\frac {1}{2} \left (c+d x^n\right )\right )\right )}-2 b^2 d x^n \tan (c)+d x^n \left (a^2 d x^n+2 b^2 \tan (c)\right )+2 b^2 \left (\log \left (\cos \left (c+d x^n\right )\right )+d x^n \tan (c)\right )\right )}{2 d^2 e n} \]
((e*x)^(2*n)*(8*a*b*ArcTan[Cot[c]]*ArcTanh[Sin[c] + Cos[c]*Tan[(d*x^n)/2]] - (4*a*b*Csc[c]*((d*x^n - ArcTan[Cot[c]])*(Log[1 - E^(I*(d*x^n - ArcTan[C ot[c]]))] - Log[1 + E^(I*(d*x^n - ArcTan[Cot[c]]))]) + I*PolyLog[2, -E^(I* (d*x^n - ArcTan[Cot[c]]))] - I*PolyLog[2, E^(I*(d*x^n - ArcTan[Cot[c]]))]) )/Sqrt[Csc[c]^2] + (2*b^2*d*x^n*Sin[(d*x^n)/2])/((Cos[c/2] - Sin[c/2])*(Co s[(c + d*x^n)/2] - Sin[(c + d*x^n)/2])) + (2*b^2*d*x^n*Sin[(d*x^n)/2])/((C os[c/2] + Sin[c/2])*(Cos[(c + d*x^n)/2] + Sin[(c + d*x^n)/2])) - 2*b^2*d*x ^n*Tan[c] + d*x^n*(a^2*d*x^n + 2*b^2*Tan[c]) + 2*b^2*(Log[Cos[c + d*x^n]] + d*x^n*Tan[c])))/(2*d^2*e*n*x^(2*n))
Time = 0.46 (sec) , antiderivative size = 148, normalized size of antiderivative = 0.67, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.208, Rules used = {4696, 4692, 3042, 4678, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (e x)^{2 n-1} \left (a+b \sec \left (c+d x^n\right )\right )^2 \, dx\) |
\(\Big \downarrow \) 4696 |
\(\displaystyle \frac {x^{-2 n} (e x)^{2 n} \int x^{2 n-1} \left (a+b \sec \left (d x^n+c\right )\right )^2dx}{e}\) |
\(\Big \downarrow \) 4692 |
\(\displaystyle \frac {x^{-2 n} (e x)^{2 n} \int x^n \left (a+b \sec \left (d x^n+c\right )\right )^2dx^n}{e n}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {x^{-2 n} (e x)^{2 n} \int x^n \left (a+b \csc \left (d x^n+c+\frac {\pi }{2}\right )\right )^2dx^n}{e n}\) |
\(\Big \downarrow \) 4678 |
\(\displaystyle \frac {x^{-2 n} (e x)^{2 n} \int \left (a^2 x^n+b^2 \sec ^2\left (d x^n+c\right ) x^n+2 a b \sec \left (d x^n+c\right ) x^n\right )dx^n}{e n}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {x^{-2 n} (e x)^{2 n} \left (\frac {1}{2} a^2 x^{2 n}-\frac {4 i a b x^n \arctan \left (e^{i \left (c+d x^n\right )}\right )}{d}+\frac {2 i a b \operatorname {PolyLog}\left (2,-i e^{i \left (d x^n+c\right )}\right )}{d^2}-\frac {2 i a b \operatorname {PolyLog}\left (2,i e^{i \left (d x^n+c\right )}\right )}{d^2}+\frac {b^2 \log \left (\cos \left (c+d x^n\right )\right )}{d^2}+\frac {b^2 x^n \tan \left (c+d x^n\right )}{d}\right )}{e n}\) |
((e*x)^(2*n)*((a^2*x^(2*n))/2 - ((4*I)*a*b*x^n*ArcTan[E^(I*(c + d*x^n))])/ d + (b^2*Log[Cos[c + d*x^n]])/d^2 + ((2*I)*a*b*PolyLog[2, (-I)*E^(I*(c + d *x^n))])/d^2 - ((2*I)*a*b*PolyLog[2, I*E^(I*(c + d*x^n))])/d^2 + (b^2*x^n* Tan[c + d*x^n])/d))/(e*n*x^(2*n))
3.1.76.3.1 Defintions of rubi rules used
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(n_.)*((c_.) + (d_.)*(x_))^(m_.) , x_Symbol] :> Int[ExpandIntegrand[(c + d*x)^m, (a + b*Csc[e + f*x])^n, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && IGtQ[m, 0] && IGtQ[n, 0]
Int[(x_)^(m_.)*((a_.) + (b_.)*Sec[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbol ] :> Simp[1/n Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a + b*Sec[c + d*x])^ p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IGtQ[Simplify[(m + 1)/n], 0] && IntegerQ[p]
Int[((e_)*(x_))^(m_.)*((a_.) + (b_.)*Sec[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x _Symbol] :> Simp[e^IntPart[m]*((e*x)^FracPart[m]/x^FracPart[m]) Int[x^m*( a + b*Sec[c + d*x^n])^p, x], x] /; FreeQ[{a, b, c, d, e, m, n, p}, x]
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 4.27 (sec) , antiderivative size = 1100, normalized size of antiderivative = 4.98
1/2*a^2/n*x*exp(1/2*(2*n-1)*(-I*Pi*csgn(I*e)*csgn(I*x)*csgn(I*e*x)+I*Pi*cs gn(I*e)*csgn(I*e*x)^2+I*Pi*csgn(I*x)*csgn(I*e*x)^2-I*Pi*csgn(I*e*x)^3+2*ln (x)+2*ln(e)))+2*I*x*exp(1/2*(2*n-1)*(-I*Pi*csgn(I*e)*csgn(I*x)*csgn(I*e*x) +I*Pi*csg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^3+Pi*csgn(I*e)*csgn(I*e *x)^2+Pi*csgn(I*x)*csgn(I*e*x)^2+2*c))-2*b/d^2/n*(e^n)^2/e*a*(-1)^(1/2*csg n(I*e)*csgn(I*x)*csgn(I*e*x))*(-exp(2*I*c))^(1/2)*dilog(1-exp(I*x^n*d)*...
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 656 vs. \(2 (207) = 414\).
Time = 0.32 (sec) , antiderivative size = 656, normalized size of antiderivative = 2.97 \[ \int (e x)^{-1+2 n} \left (a+b \sec \left (c+d x^n\right )\right )^2 \, dx=\frac {a^{2} d^{2} e^{2 \, n - 1} x^{2 \, n} \cos \left (d x^{n} + c\right ) + 2 \, b^{2} d e^{2 \, n - 1} x^{n} \sin \left (d x^{n} + c\right ) - 2 i \, a b e^{2 \, n - 1} \cos \left (d x^{n} + c\right ) {\rm Li}_2\left (i \, \cos \left (d x^{n} + c\right ) + \sin \left (d x^{n} + c\right )\right ) - 2 i \, a b e^{2 \, n - 1} \cos \left (d x^{n} + c\right ) {\rm Li}_2\left (i \, \cos \left (d x^{n} + c\right ) - \sin \left (d x^{n} + c\right )\right ) + 2 i \, a b e^{2 \, n - 1} \cos \left (d x^{n} + c\right ) {\rm Li}_2\left (-i \, \cos \left (d x^{n} + c\right ) + \sin \left (d x^{n} + c\right )\right ) + 2 i \, a b e^{2 \, n - 1} \cos \left (d x^{n} + c\right ) {\rm Li}_2\left (-i \, \cos \left (d x^{n} + c\right ) - \sin \left (d x^{n} + c\right )\right ) - {\left (2 \, a b c - b^{2}\right )} e^{2 \, n - 1} \cos \left (d x^{n} + c\right ) \log \left (\cos \left (d x^{n} + c\right ) + i \, \sin \left (d x^{n} + c\right ) + i\right ) + {\left (2 \, a b c + b^{2}\right )} e^{2 \, n - 1} \cos \left (d x^{n} + c\right ) \log \left (\cos \left (d x^{n} + c\right ) - i \, \sin \left (d x^{n} + c\right ) + i\right ) - {\left (2 \, a b c - b^{2}\right )} e^{2 \, n - 1} \cos \left (d x^{n} + c\right ) \log \left (-\cos \left (d x^{n} + c\right ) + i \, \sin \left (d x^{n} + c\right ) + i\right ) + {\left (2 \, a b c + b^{2}\right )} e^{2 \, n - 1} \cos \left (d x^{n} + c\right ) \log \left (-\cos \left (d x^{n} + c\right ) - i \, \sin \left (d x^{n} + c\right ) + i\right ) + 2 \, {\left (a b d e^{2 \, n - 1} x^{n} + a b c e^{2 \, n - 1}\right )} \cos \left (d x^{n} + c\right ) \log \left (i \, \cos \left (d x^{n} + c\right ) + \sin \left (d x^{n} + c\right ) + 1\right ) - 2 \, {\left (a b d e^{2 \, n - 1} x^{n} + a b c e^{2 \, n - 1}\right )} \cos \left (d x^{n} + c\right ) \log \left (i \, \cos \left (d x^{n} + c\right ) - \sin \left (d x^{n} + c\right ) + 1\right ) + 2 \, {\left (a b d e^{2 \, n - 1} x^{n} + a b c e^{2 \, n - 1}\right )} \cos \left (d x^{n} + c\right ) \log \left (-i \, \cos \left (d x^{n} + c\right ) + \sin \left (d x^{n} + c\right ) + 1\right ) - 2 \, {\left (a b d e^{2 \, n - 1} x^{n} + a b c e^{2 \, n - 1}\right )} \cos \left (d x^{n} + c\right ) \log \left (-i \, \cos \left (d x^{n} + c\right ) - \sin \left (d x^{n} + c\right ) + 1\right )}{2 \, d^{2} n \cos \left (d x^{n} + c\right )} \]
1/2*(a^2*d^2*e^(2*n - 1)*x^(2*n)*cos(d*x^n + c) + 2*b^2*d*e^(2*n - 1)*x^n* sin(d*x^n + c) - 2*I*a*b*e^(2*n - 1)*cos(d*x^n + c)*dilog(I*cos(d*x^n + c) + sin(d*x^n + c)) - 2*I*a*b*e^(2*n - 1)*cos(d*x^n + c)*dilog(I*cos(d*x^n + c) - sin(d*x^n + c)) + 2*I*a*b*e^(2*n - 1)*cos(d*x^n + c)*dilog(-I*cos(d *x^n + c) + sin(d*x^n + c)) + 2*I*a*b*e^(2*n - 1)*cos(d*x^n + c)*dilog(-I* cos(d*x^n + c) - sin(d*x^n + c)) - (2*a*b*c - b^2)*e^(2*n - 1)*cos(d*x^n + c)*log(cos(d*x^n + c) + I*sin(d*x^n + c) + I) + (2*a*b*c + b^2)*e^(2*n - 1)*cos(d*x^n + c)*log(cos(d*x^n + c) - I*sin(d*x^n + c) + I) - (2*a*b*c - b^2)*e^(2*n - 1)*cos(d*x^n + c)*log(-cos(d*x^n + c) + I*sin(d*x^n + c) + I ) + (2*a*b*c + b^2)*e^(2*n - 1)*cos(d*x^n + c)*log(-cos(d*x^n + c) - I*sin (d*x^n + c) + I) + 2*(a*b*d*e^(2*n - 1)*x^n + a*b*c*e^(2*n - 1))*cos(d*x^n + c)*log(I*cos(d*x^n + c) + sin(d*x^n + c) + 1) - 2*(a*b*d*e^(2*n - 1)*x^ n + a*b*c*e^(2*n - 1))*cos(d*x^n + c)*log(I*cos(d*x^n + c) - sin(d*x^n + c ) + 1) + 2*(a*b*d*e^(2*n - 1)*x^n + a*b*c*e^(2*n - 1))*cos(d*x^n + c)*log( -I*cos(d*x^n + c) + sin(d*x^n + c) + 1) - 2*(a*b*d*e^(2*n - 1)*x^n + a*b*c *e^(2*n - 1))*cos(d*x^n + c)*log(-I*cos(d*x^n + c) - sin(d*x^n + c) + 1))/ (d^2*n*cos(d*x^n + c))
\[ \int (e x)^{-1+2 n} \left (a+b \sec \left (c+d x^n\right )\right )^2 \, dx=\int \left (e x\right )^{2 n - 1} \left (a + b \sec {\left (c + d x^{n} \right )}\right )^{2}\, dx \]
\[ \int (e x)^{-1+2 n} \left (a+b \sec \left (c+d x^n\right )\right )^2 \, dx=\int { {\left (b \sec \left (d x^{n} + c\right ) + a\right )}^{2} \left (e x\right )^{2 \, n - 1} \,d x } \]
1/2*(e*x)^(2*n)*a^2/(e*n) + (2*b^2*e^(2*n)*x^n*sin(2*d*x^n + 2*c) + (d*e*n *cos(2*d*x^n + 2*c)^2 + d*e*n*sin(2*d*x^n + 2*c)^2 + 2*d*e*n*cos(2*d*x^n + 2*c) + d*e*n)*integrate(2*(2*a*b*d*e^(2*n)*x^(2*n)*cos(2*d*x^n + 2*c)*cos (d*x^n + c) + 2*a*b*d*e^(2*n)*x^(2*n)*cos(d*x^n + c) + (2*a*b*d*e^(2*n)*x^ (2*n)*sin(d*x^n + c) - b^2*e^(2*n)*x^n)*sin(2*d*x^n + 2*c))/(d*e*x*cos(2*d *x^n + 2*c)^2 + d*e*x*sin(2*d*x^n + 2*c)^2 + 2*d*e*x*cos(2*d*x^n + 2*c) + d*e*x), x))/(d*e*n*cos(2*d*x^n + 2*c)^2 + d*e*n*sin(2*d*x^n + 2*c)^2 + 2*d *e*n*cos(2*d*x^n + 2*c) + d*e*n)
\[ \int (e x)^{-1+2 n} \left (a+b \sec \left (c+d x^n\right )\right )^2 \, dx=\int { {\left (b \sec \left (d x^{n} + c\right ) + a\right )}^{2} \left (e x\right )^{2 \, n - 1} \,d x } \]
Timed out. \[ \int (e x)^{-1+2 n} \left (a+b \sec \left (c+d x^n\right )\right )^2 \, dx=\int {\left (a+\frac {b}{\cos \left (c+d\,x^n\right )}\right )}^2\,{\left (e\,x\right )}^{2\,n-1} \,d x \]